﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Nop.Services.Catalog;
using Nop.Core;
using Nop.Services.Media;
using Spotshub.Api.Filter;

namespace Spotshub.Api.Controllers.V1
{
    [ExceptionHandler]
    public class PictureController : ApiController
    {
        IPictureService _pictureService;

        public PictureController(IPictureService pictureService)
        {
            this._pictureService = pictureService;
        }

        // GET: api/picture/get/5
        public string Get(int id, int targetSize=0)
        {
            string url = _pictureService.GetPictureUrl(id, targetSize);
            return url;
        }
    }
}
